/**
 * Created by ZYMS on 2018/4/28.
 */

$(function () {
    getData();
});   

function getData() {
    var url="/pioneer/media/getGuessYouLike.html";
    var postData={mediaType:1,length:10};
    $.ajax({
        type: 'POST',
        url: url,
        async: true,
        data:postData,
        dataType:'json',
        success: function(data){
            console.log(data);
            if (data.code != 1){
                layer.msg('操作失败!',{icon : 5,time : 1000});
                console.log(data.msg); 
                return;
            }
            showData(data.data);
        }
    });

}
 function change() {
     getData();
 }
function showData(data) {
    var payUrl="/pioneer/media/playVideo.html";
    
    var html="";
    
    
    for (i=0;i<data.length;i++){
        html+=" <li>";
        html+="  <div class=\"guess-img\">";
        html+="     <a href=\""+payUrl+"?tid="+data[i].tid+"\">";
        html+="         <img src=\""+picPath+data[i].mediaPic+"\" alt=\"\" />";
        html+="         <div class='guess_img_002'><img src='/static/images/web/pioneer/index/u175.png' alt=''></div>";
        html+="     </a>";
        html+="   </div>";
        html+="   <div class=\"guess-down\">";
        html+="    <p><a href=\""+payUrl+"?tid="+data[i].tid+"\">"+data[i].mediaName+"</a></p>";
        html+=" </div>";
        html+="  </li>";
    }
    
    $(".guesslikebox ul").html(html);
}